package com.hlk.user;

import com.hlk.pojo.bo.RegistLoginBO;
import com.hlk.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author hlk
 * @version 1.0
 * @date 2020-12-15 15:43
 */
@Api(value = "用户注册登录", tags = "用户注册登录")
@RequestMapping("passport")
public interface PassportControllerApi {

    @GetMapping("getSMSCode")
    @ApiOperation(value = "获取短信验证码")
    Result getSMSCode(@RequestParam String mobile, HttpServletRequest request);

    @PostMapping("doLogin")
    @ApiOperation(value = "一键注册登录接口")
    Result doLogin(@RequestBody RegistLoginBO registLoginBO, BindingResult result, HttpServletRequest request, HttpServletResponse response);


    @ApiOperation(value = "用户退出登录")
    @PostMapping("/logout")
    public Result logout(@RequestParam String userId, HttpServletRequest request, HttpServletResponse response);
}
